package controller.api;
import com.jfinal.aop.Before;
import com.jfinal.aop.Inject;
import com.jfinal.kit.Ret;

import common.inter.ServicerStationInter;
import common.inter.StaffStationInter;
import model.SysetemParams;
import service.SysetemParamsService;

public class ApiSysetemParamsController extends BaseApiController {
	@Inject SysetemParamsService sysetemParamsService ;

	@Before(ServicerStationInter.class)
	public void info() {
		Long stationId = getParaToLong("id");
		SysetemParams sysetemParams = SysetemParams.dao.findFirstByStationId(stationId);
        set("data", sysetemParams );
        renderJson();
	}

	@Before(StaffStationInter.class)
	public void save() {
		SysetemParams sysetemParams = getModel(SysetemParams.class , "x");
        Ret ret = sysetemParamsService.save(sysetemParams,getStation() , getStaff());
        renderJson(ret);
	}
}
